package com.isotronica.neveras.logica;

import java.io.IOException;
import java.net.ServerSocket;


public class ListenerNeveras extends Thread{
	
	private ServerSocket miSocket;
	private DataDecoder dataDecoder;
	private Thread miThread;
	
	private Controlador miControlador;
	;
	
	public ListenerNeveras(Controlador miControlador) {
		try {
			this.miControlador = miControlador;
			miSocket = new ServerSocket(3002);			
			miThread = new Thread(this);
			miThread.start();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public void run(){
		while(true){
			try {
				dataDecoder = new DataDecoder(miSocket.accept(), miControlador);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
	
	
}
